SET IDENTITY_INSERT [CMS_Query] ON
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10371, N'selectcategoryreports', 0, N'SELECT ##COLUMNS## FROM View_Reporting_CategoryReport_Joined WHERE
 ##WHERE##', 0, 1431, 0, '20101005 09:57:51', '15927e00-b32b-4c29-b6d5-c49f3545f440', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10348, N'selectallview', 0, N'SELECT ##COLUMNS## FROM View_Reporting_CategoryReport_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1431, 0, '20101005 09:58:28', '924ad18f-9871-4e22-80cb-77820c6fd181', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2051, N'selectAllowedPageTemplates', 0, N'SELECT CMS_PageTemplate.* FROM CMS_PageTemplate INNER JOIN CMS_PageTemplateSite ON CMS_PageTemplate.PageTemplateID = CMS_PageTemplateSite.PageTemplateID INNER JOIN CMS_PageTemplateCategory ON CMS_PageTemplate.PageTemplateCategoryID = CMS_PageTemplateCategory.CategoryID WHERE (CMS_PageTemplateSite.SiteID = @SiteID) AND (CMS_PageTemplateCategory.CategoryDisplayName <> ''ad-hoc'') AND ((@CategoryID=0) OR (CMS_PageTemplate.PageTemplateCategoryID = @CategoryID)) ORDER BY ##ORDERBY##', 0, 157, 0, '20101005 10:27:14', 'f9557146-fb1c-4f96-bcb9-cb04409fcfe5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (685, N'selectSubCategories', 0, N'SELECT COUNT(CategoryID) AS Expr1 FROM CMS_WebPartCategory WHERE (CategoryParentID = @ID)', 0, 424, 0, '20101005 10:59:10', 'e7370ed9-885e-4a26-a0b4-4ef23ae4fb67', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (493, N'selectcultures', 0, N'SELECT CMS_Culture.*, CMS_SiteCulture.SiteID FROM CMS_Culture LEFT OUTER JOIN CMS_SiteCulture ON CMS_SiteCulture.CultureID = CMS_Culture.CultureID AND (CMS_SiteCulture.SiteID = @siteID OR CMS_SiteCulture.SiteID IS NULL) ORDER BY ##ORDERBY##', 0, 52, 0, '20101005 11:14:22', '9d404013-afe8-48f0-8c21-ea0f300aa6ad', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (778, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_WebTemplate WHERE [WebTemplateID] = @ID', 0, 500, 0, '20081229 09:07:41', 'f6638118-1c42-4487-82ad-6a53f7b6c978', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (786, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebTemplate WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 500, 0, '20081229 09:07:41', 'b2f30cbc-97f6-49b7-9cf8-3064b076f0b5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5020, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebTemplate WHERE (WebTemplateLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 500, 0, '20091012 08:13:26', '5b1f6743-6125-4725-8cd1-5a3810860a89', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11118, N'SelectForOptionIDWeight', 0, N'SELECT   TOP 1 *
FROM         COM_ShippingCost
WHERE     (ShippingCostMinWeight <= @Weight) AND (ShippingCostShippingOptionID = @ShippingOptionID)
ORDER BY ShippingCostMinWeight DESC', 0, 2461, 0, '20101018 10:47:42', 'd3d48e96-4c8a-4859-828b-c5b244e87ce3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11145, N'selectconversion', 0, N'SELECT ##COLUMNS## FROM Analytics_Statistics WHERE ##WHERE## GROUP BY StatisticsObjectName', 0, 1366, 0, '20101022 09:40:43', '2c602f05-ba39-4d32-92b9-8166224a9841', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2697, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_DiscountCoupon WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1149, 0, '20081229 09:07:00', 'a3947a85-cda2-41fd-902a-1633c1f199e6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3828, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_DiscountLevel WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1429, 0, '20081229 09:07:00', 'cd8d3054-59cb-41a0-b06f-6f8410329ca1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2649, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Manufacturer WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1142, 0, '20081229 09:07:01', 'b8b9f669-4a39-4224-bb1c-b64205c79568', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2644, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Supplier WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1141, 0, '20081229 09:07:03', 'c939e1b4-be4a-4139-ac25-cd6eb0ed4a3d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2687, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Department WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1148, 0, '20081229 09:07:00', '7369c560-9359-4475-8901-28ac0bc75494', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2727, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_TaxClass WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1152, 0, '20081229 09:07:03', '6b9b903b-5f11-40d3-8579-0b9127c0c645', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2670, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_PublicStatus WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1145, 0, '20081229 09:07:02', 'ff2e6a1d-6ce1-4554-bc89-383690a46818', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2681, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_InternalStatus WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1147, 0, '20081229 09:07:00', '801f6de3-e320-4368-a093-c7fc944999cc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10297, N'select', 0, N'SELECT ##COLUMNS## FROM Temp_File WHERE [FileID] = @ID', 0, 2426, 0, '20100629 13:54:35', '4a3aa975-aa87-4111-a4c6-a5e2c1833e17', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10298, N'delete', 0, N'DELETE FROM Temp_File WHERE [FileID] = @ID', 0, 2426, 0, '20100629 13:54:35', 'bcdedad2-672f-4474-a068-93c71847bbd2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10299, N'insert', 0, N'INSERT INTO Temp_File ([FileParentGUID], [FileNumber], [FileExtension], [FileSize], [FileMimeType], [FileImageWidth], [FileImageHeight], [FileBinary], [FileGUID], [FileLastModified], [FileDirectory], [FileName], [FileTitle], [FileDescription] ) VALUES ( @FileParentGUID, @FileNumber, @FileExtension, @FileSize, @FileMimeType, @FileImageWidth, @FileImageHeight, @FileBinary, @FileGUID, @FileLastModified, @FileDirectory, @FileName, @FileTitle, @FileDescription); SELECT SCOPE_IDENTITY() AS [FileID]', 1, 2426, 0, '20100629 13:54:35', 'af8ac24a-7c32-4646-b775-40f8b3e1e8d6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10300, N'update', 0, N'UPDATE Temp_File SET [FileParentGUID] = @FileParentGUID, [FileNumber] = @FileNumber, [FileExtension] = @FileExtension, [FileSize] = @FileSize, [FileMimeType] = @FileMimeType, [FileImageWidth] = @FileImageWidth, [FileImageHeight] = @FileImageHeight, [FileBinary] = @FileBinary, [FileGUID] = @FileGUID, [FileLastModified] = @FileLastModified, [FileDirectory] = @FileDirectory, [FileName] = @FileName, [FileTitle] = @FileTitle, [FileDescription] = @FileDescription WHERE [FileID] = @FileID', 0, 2426, 0, '20100629 13:54:35', '48679cea-cc40-4f42-88fb-51ed80e0821d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10301, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Temp_File WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2426, 0, '20100629 13:54:35', 'cbb53e10-b83d-4bfa-a89d-1071b2451b97', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4647, N'selectbydocumentidnobinary', 0, N'SELECT ##TOPN## AttachmentID, AttachmentName, AttachmentExtension, AttachmentSize, AttachmentMimeType, AttachmentImageWidth, AttachmentImageHeight, AttachmentDocumentID, AttachmentGUID, AttachmentLastHistoryID, AttachmentSiteID, AttachmentLastModified,AttachmentIsUnsorted, AttachmentOrder, AttachmentGroupGUID, AttachmentFormGUID, AttachmentDocumentID, AttachmentTitle, AttachmentDescription, AttachmentCustomData FROM CMS_Attachment WHERE AttachmentDocumentID = @AttachmentDocumentID', 0, 504, 0, '20101104 12:49:43', '1dcec97c-d8dc-45d3-b41d-d8b3ef2b2afc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8788, N'getlastversionwithoutbinary', 0, N'SELECT TOP 1 AttachmentHistoryID, AttachmentName, AttachmentExtension, AttachmentSize, AttachmentMimeType, AttachmentImageWidth, AttachmentImageHeight, AttachmentDocumentID, AttachmentGUID, AttachmentIsUnsorted, AttachmentOrder, AttachmentGroupGUID, AttachmentTitle, AttachmentDescription, AttachmentCustomData FROM CMS_AttachmentHistory WHERE AttachmentGUID = @AttachmentGUID AND AttachmentHistoryID IN (SELECT AttachmentHistoryID FROM CMS_VersionAttachment WHERE VersionHistoryID IN (SELECT VersionHistoryID FROM CMS_VersionHistory WHERE NodeSiteID=@SiteID)) ORDER BY AttachmentHistoryID DESC', 0, 516, 0, '20101104 13:34:37', '728b28b8-13f3-4836-b83e-bb8b903dafcc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4920, N'selectbyguidnobinary', 0, N'SELECT MetaFileID, MetaFileObjectID, MetaFileObjectType, MetaFileGroupName, MetaFileName, MetaFileExtension, MetaFileSize, MetaFileMimeType, MetaFileImageWidth, MetaFileImageHeight, MetaFileGUID, MetaFileLastModified, [MetaFileTitle], [MetaFileDescription], [MetaFileCustomData] FROM CMS_MetaFile WHERE [MetaFileGUID] = @Guid', 0, 1527, 0, '20101111 17:45:31', '777c6aae-2485-486d-ac82-21e4dc332731', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11601, N'select', 0, N'SELECT ##COLUMNS## FROM Newsletter_Link WHERE [LinkID] = @ID', 0, 2694, 0, '20101118 10:36:25', '3ed082be-5f4b-415a-b6c8-781075fee1b0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11602, N'delete', 0, N'DELETE FROM Newsletter_Link WHERE [LinkID] = @ID', 0, 2694, 0, '20101118 10:36:25', '8b33826a-af15-4ad8-b814-4f35de33bf4f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11603, N'insert', 0, N'INSERT INTO Newsletter_Link ([LinkIssueID], [LinkTarget], [LinkDescription], [LinkOutdated], [LinkTotalClicks], [LinkGUID] ) VALUES ( @LinkIssueID, @LinkTarget, @LinkDescription, @LinkOutdated, @LinkTotalClicks, @LinkGUID); SELECT SCOPE_IDENTITY() AS [LinkID]', 1, 2694, 0, '20101118 10:36:25', '366e547d-5d0f-453d-954f-12e6dddab9f1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11604, N'update', 0, N'UPDATE Newsletter_Link SET [LinkIssueID] = @LinkIssueID, [LinkTarget] = @LinkTarget, [LinkDescription] = @LinkDescription, [LinkOutdated] = @LinkOutdated, [LinkTotalClicks] = @LinkTotalClicks, [LinkGUID] = @LinkGUID WHERE [LinkID] = @LinkID', 0, 2694, 0, '20101118 10:36:25', '6f385798-db7f-42c0-9b30-5da4fa694e34', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11605, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Newsletter_Link WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2694, 0, '20101118 10:36:25', 'faa935f0-e4ff-4b2f-b00f-bb493eb39abf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11618, N'select', 0, N'SELECT ##COLUMNS## FROM Newsletter_SubscriberLink WHERE [SubscriberID] = @SubscriberID AND [LinkID] = @LinkID', 0, 2697, 0, '20101119 10:10:02', 'd3108ef4-2012-46a3-b366-119937ab7305', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11619, N'delete', 0, N'DELETE FROM Newsletter_SubscriberLink WHERE [SubscriberID] = @SubscriberID AND [LinkID] = @LinkID', 0, 2697, 0, '20101119 10:10:02', 'd437ed15-09a6-445f-94d2-88538a359c94', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11620, N'insert', 0, N'INSERT INTO Newsletter_SubscriberLink ([SubscriberID], [LinkID], [Clicks] ) VALUES ( @SubscriberID, @LinkID, @Clicks);', 1, 2697, 0, '20101119 10:10:02', '7534c9c2-eb50-4182-99a6-071a8380c215', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11621, N'update', 0, N'UPDATE Newsletter_SubscriberLink SET [Clicks] = @Clicks WHERE [SubscriberID] = @SubscriberID AND [LinkID] = @LinkID', 0, 2697, 0, '20101119 10:10:02', '85a8248b-b9d1-4dba-a0b2-df939eb72913', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11622, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Newsletter_SubscriberLink WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2697, 0, '20101119 10:10:02', 'b77a5269-a73f-4b8a-a53b-3286b14d6586', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1111, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_FormUserControl WHERE [UserControlID] = @ID', 0, 846, 0, '20081229 09:07:07', '30d681e6-9d9e-4671-a9af-b8368222e9c2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1133, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_FormUserControl WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 846, 0, '20081229 09:07:07', 'a36686c8-8a42-438d-8393-70dcda77e101', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4851, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_FormUserControl WHERE (UserControlLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 846, 0, '20081229 09:07:07', 'c9fc03eb-631a-41a8-b82a-8142348a3c21', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (917, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Site WHERE [SiteID] = @ID', 0, 52, 0, '20081229 09:07:23', 'f4f7f3c8-3301-4b47-922c-edc33a78b82a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (39, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Site WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 52, 0, '20081229 09:07:23', 'eeb26566-9a54-4554-885e-971cb8a4b692', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4859, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Site WHERE (SiteLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 52, 0, '20081229 09:07:23', '611932cd-7c47-4cfc-b85f-6b02b6a1cc3d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6377, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM BadWords_Word WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1771, 0, '20081229 09:06:54', '171a4848-71e2-458f-ac2e-1ab76fcb51c6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11640, N'selecttranslated', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_ResourceTranslated_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1650, 0, '20101126 09:33:05', '558a5c26-db6e-4856-9570-6221e47dd484', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8818, N'selectattachmentsversions', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined_Versions_Attachments WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 144, 0, '20101126 14:24:36', 'f5cf2412-8e57-433f-ac9a-f2abbe2d0661', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11652, N'markrecipientdelete', 0, N'UPDATE Messaging_Message SET [MessageRecipientDeleted] = 1 WHERE ##WHERE##', 0, 1593, 0, '20101129 21:10:45', '1d971b35-73b2-43a5-9680-7fd778389231', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11653, N'marksenderdelete', 0, N'UPDATE Messaging_Message SET [MessageSenderDeleted] = 1 WHERE ##WHERE##', 0, 1593, 0, '20101129 21:10:53', 'c7ed5613-80b6-4b4b-b950-28f543e055eb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7194, N'selectDocumentsTags', 0, N'SELECT ##TOPN## CMS_Tag.TagID, TagName, COUNT(DocumentID) AS TagCount FROM CMS_DocumentTag JOIN CMS_Tag ON CMS_DocumentTag.TagID = CMS_Tag.TagID JOIN CMS_TagGroup ON CMS_Tag.TagGroupID = CMS_TagGroup.TagGroupID WHERE (DocumentID IN (SELECT DocumentID FROM View_CMS_Tree_Joined WHERE ##WHERE##)) GROUP BY CMS_Tag.TagID, TagName ORDER BY ##ORDERBY##', 0, 1738, 0, '20101202 14:48:48', '88d1f935-648f-4c08-855c-0f85c8dc2cf7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11791, N'select', 0, N'SELECT ##COLUMNS## FROM PM_Project WHERE [ProjectID] = @ID', 0, 2742, 0, '20101213 11:05:08', '2630f30a-e689-4310-9c90-ffecaf63e08c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11792, N'delete', 0, N'DELETE FROM PM_Project WHERE [ProjectID] = @ID', 0, 2742, 0, '20101213 11:05:08', '3e43d63d-dc8b-4111-8526-9a8b78d8dbec', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11793, N'insert', 0, N'INSERT INTO PM_Project ([ProjectNodeID], [ProjectGroupID], [ProjectDisplayName], [ProjectName], [ProjectDescription], [ProjectStartDate], [ProjectDeadline], [ProjectOwner], [ProjectCreatedByID], [ProjectStatusID], [ProjectSiteID], [ProjectGUID], [ProjectLastModified], [ProjectAllowOrdering], [ProjectAccess] ) VALUES ( @ProjectNodeID, @ProjectGroupID, @ProjectDisplayName, @ProjectName, @ProjectDescription, @ProjectStartDate, @ProjectDeadline, @ProjectOwner, @ProjectCreatedByID, @ProjectStatusID, @ProjectSiteID, @ProjectGUID, @ProjectLastModified, @ProjectAllowOrdering, @ProjectAccess); SELECT SCOPE_IDENTITY() AS [ProjectID]', 1, 2742, 0, '20101213 11:05:08', 'c737d1a7-66c9-4342-981a-710706ba51b0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11794, N'update', 0, N'UPDATE PM_Project SET [ProjectNodeID] = @ProjectNodeID, [ProjectGroupID] = @ProjectGroupID, [ProjectDisplayName] = @ProjectDisplayName, [ProjectName] = @ProjectName, [ProjectDescription] = @ProjectDescription, [ProjectStartDate] = @ProjectStartDate, [ProjectDeadline] = @ProjectDeadline, [ProjectOwner] = @ProjectOwner, [ProjectCreatedByID] = @ProjectCreatedByID, [ProjectStatusID] = @ProjectStatusID, [ProjectSiteID] = @ProjectSiteID, [ProjectGUID] = @ProjectGUID, [ProjectLastModified] = @ProjectLastModified, [ProjectAllowOrdering] = @ProjectAllowOrdering, [ProjectAccess] = @ProjectAccess WHERE [ProjectID] = @ProjectID', 0, 2742, 0, '20101213 11:05:08', 'a46f874c-b9c0-44c8-8979-bfdde10b7816', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11795, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM PM_Project WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2742, 0, '20101213 11:05:08', '694f805a-f69c-4f2e-bb71-2879d0cf18f7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11796, N'deleteall', 0, N'DELETE FROM PM_Project WHERE ##WHERE##', 0, 2742, 0, '20101213 11:05:08', '57ad6b12-3e9c-44da-bd04-f6830e21706e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11797, N'updateall', 0, N'UPDATE PM_Project SET ##COLUMNS## WHERE ##WHERE##', 0, 2742, 0, '20101213 11:05:08', '30764ed3-3695-47fc-b53b-baafb4fb61fc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11798, N'GetProjectProgress', 1, N'Proc_PM_Project_GetProjectProgress', 0, 2742, 0, '20101213 11:31:20', 'c69e5868-c9ee-44fa-878b-3e8571668db3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11800, N'removedependencies', 1, N'Proc_PM_Project_RemoveDependencies', 1, 2742, 0, '20101213 11:32:21', 'a0fb918d-70fe-4fc4-aa60-5d90a49272dc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11801, N'ResetProjectOrder', 1, N'Proc_PM_Project_ResetProjectOrder', 0, 2742, 0, '20101213 11:32:37', 'a50453eb-7dee-4c9f-bbbb-243b5b9a0bea', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11802, N'selectalljoined', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_PM_ProjectStatus_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2742, 0, '20101213 11:33:11', '04c0d848-7028-4d46-a173-8ea0bfc0c8dc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11803, N'selectmodifiedfrom', 0, N'SELECT * FROM PM_Project WHERE (ProjectLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2742, 0, '20101213 11:33:30', '27445329-85f1-4528-8ce7-1abb12984a53', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11809, N'deleteall', 0, N'DELETE FROM PM_ProjectRolePermission WHERE ##WHERE##', 0, 2743, 0, '20101213 11:36:09', 'f9c71b84-df52-4bf8-9cfc-0275575b0480', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11810, N'updateall', 0, N'UPDATE PM_ProjectRolePermission SET ##COLUMNS## WHERE ##WHERE##', 0, 2743, 0, '20101213 11:36:09', 'beb86627-a800-4094-abea-6b0ebabf5087', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11804, N'select', 0, N'SELECT ##COLUMNS## FROM PM_ProjectRolePermission WHERE [ProjectID] = @ID', 0, 2743, 0, '20101213 11:36:09', 'ee20b176-a8ea-4063-a7bc-33d688bc96d6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11807, N'update', 0, N'UPDATE PM_ProjectRolePermission SET [RoleID] = @RoleID, [PermissionID] = @PermissionID WHERE [ProjectID] = @ProjectID', 0, 2743, 0, '20101213 11:36:09', 'c494f744-b015-4c4f-a041-9e281b1ba539', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11808, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM PM_ProjectRolePermission WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2743, 0, '20101213 11:36:09', '5de8e01e-5db2-4498-a4b5-60316f408580', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11805, N'delete', 0, N'DELETE FROM PM_ProjectRolePermission WHERE [ProjectID] = @ProjectID AND [RoleID] = @RoleID AND [PermissionID] = @PermissionID', 0, 2743, 0, '20101213 11:38:56', 'b24ba00e-420a-4e64-a4c5-bccdeeb4ed2c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11806, N'insert', 0, N'INSERT INTO PM_ProjectRolePermission ([ProjectID], [RoleID], [PermissionID] ) VALUES ( @ProjectID, @RoleID, @PermissionID); SELECT SCOPE_IDENTITY() AS [ProjectID]', 1, 2743, 0, '20101213 11:39:17', '6e5c0b9b-ce2e-434e-8acc-396388a309cf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11817, N'deleteall', 0, N'DELETE FROM PM_ProjectStatus WHERE ##WHERE##', 0, 2744, 0, '20101213 11:50:08', '0c5d8daa-bd0c-4950-9a6d-bd4a40706026', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11818, N'updateall', 0, N'UPDATE PM_ProjectStatus SET ##COLUMNS## WHERE ##WHERE##', 0, 2744, 0, '20101213 11:50:08', '07088983-ebaf-4e5c-90a7-2092d99cdbcc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11812, N'select', 0, N'SELECT ##COLUMNS## FROM PM_ProjectStatus WHERE [StatusID] = @ID', 0, 2744, 0, '20101213 11:50:08', '91f32622-61ec-4eda-9a50-d14331c038b5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11813, N'delete', 0, N'DELETE FROM PM_ProjectStatus WHERE [StatusID] = @ID', 0, 2744, 0, '20101213 11:50:08', 'bbff1b9c-79f3-4a08-9a36-1ba2083129bd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11814, N'insert', 0, N'INSERT INTO PM_ProjectStatus ([StatusName], [StatusDisplayName], [StatusOrder], [StatusColor], [StatusIcon], [StatusGUID], [StatusLastModified], [StatusEnabled], [StatusIsFinished], [StatusIsNotStarted] ) VALUES ( @StatusName, @StatusDisplayName, @StatusOrder, @StatusColor, @StatusIcon, @StatusGUID, @StatusLastModified, @StatusEnabled, @StatusIsFinished, @StatusIsNotStarted); SELECT SCOPE_IDENTITY() AS [StatusID]', 1, 2744, 0, '20101213 11:50:08', '6cc537f0-f526-4ec4-a21d-a71176bf2484', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11815, N'update', 0, N'UPDATE PM_ProjectStatus SET [StatusName] = @StatusName, [StatusDisplayName] = @StatusDisplayName, [StatusOrder] = @StatusOrder, [StatusColor] = @StatusColor, [StatusIcon] = @StatusIcon, [StatusGUID] = @StatusGUID, [StatusLastModified] = @StatusLastModified, [StatusEnabled] = @StatusEnabled, [StatusIsFinished] = @StatusIsFinished, [StatusIsNotStarted] = @StatusIsNotStarted WHERE [StatusID] = @StatusID', 0, 2744, 0, '20101213 11:50:08', 'b3eee92f-d319-4996-88f2-6698920c61f6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11816, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM PM_ProjectStatus WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2744, 0, '20101213 11:50:08', 'a16cdf19-82eb-4614-b796-b6250247cb5f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11820, N'movedown', 1, N'Proc_PM_ProjectStatus_MoveDown', 1, 2744, 0, '20101213 11:59:22', '3dae1b87-f55f-4d2b-b23e-e39845d9cbd7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11821, N'moveup', 1, N'Proc_PM_ProjectStatus_MoveUp', 1, 2744, 0, '20101213 11:59:40', '5af38d17-fdb6-42d2-95c1-7b8d562f0afc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11819, N'initstatusorder', 1, N'Proc_PM_ProjectStatus_InitOrders', 1, 2744, 0, '20101213 12:00:23', '8cac0ae1-b9a1-4fda-9383-61071bb13247', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11823, N'selectmodifiedfrom', 0, N'SELECT * FROM PM_ProjectStatus WHERE (StatusLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2744, 0, '20101213 12:01:17', 'a5c89047-2da3-4620-91af-23fbe3d5269a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11824, N'select', 0, N'SELECT ##COLUMNS## FROM PM_ProjectTask WHERE [ProjectTaskID] = @ID', 0, 2745, 0, '20101213 12:02:20', '2425f18e-0ea6-48b5-8b60-d367bd2acae8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11825, N'delete', 0, N'DELETE FROM PM_ProjectTask WHERE [ProjectTaskID] = @ID', 0, 2745, 0, '20101213 12:02:20', '7f3c196b-018e-4e98-b657-b260042cc428', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11826, N'insert', 0, N'INSERT INTO PM_ProjectTask ([ProjectTaskProjectID], [ProjectTaskDisplayName], [ProjectTaskDeadline], [ProjectTaskStatusID], [ProjectTaskPriorityID], [ProjectTaskDescription], [ProjectTaskOwnerID], [ProjectTaskCreatedByID], [ProjectTaskAssignedToUserID], [ProjectTaskProgress], [ProjectTaskHours], [ProjectTaskGUID], [ProjectTaskLastModified], [ProjectTaskProjectOrder], [ProjectTaskUserOrder], [ProjectTaskNotificationSent], [ProjectTaskIsPrivate] ) VALUES ( @ProjectTaskProjectID, @ProjectTaskDisplayName, @ProjectTaskDeadline, @ProjectTaskStatusID, @ProjectTaskPriorityID, @ProjectTaskDescription, @ProjectTaskOwnerID, @ProjectTaskCreatedByID, @ProjectTaskAssignedToUserID, @ProjectTaskProgress, @ProjectTaskHours, @ProjectTaskGUID, @ProjectTaskLastModified, @ProjectTaskProjectOrder, @ProjectTaskUserOrder, @ProjectTaskNotificationSent, @ProjectTaskIsPrivate); SELECT SCOPE_IDENTITY() AS [ProjectTaskID]', 1, 2745, 0, '20101213 12:02:20', '3213aa55-78da-4b09-b180-634e2e31c64c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11827, N'update', 0, N'UPDATE PM_ProjectTask SET [ProjectTaskProjectID] = @ProjectTaskProjectID, [ProjectTaskDisplayName] = @ProjectTaskDisplayName, [ProjectTaskDeadline] = @ProjectTaskDeadline, [ProjectTaskStatusID] = @ProjectTaskStatusID, [ProjectTaskPriorityID] = @ProjectTaskPriorityID, [ProjectTaskDescription] = @ProjectTaskDescription, [ProjectTaskOwnerID] = @ProjectTaskOwnerID, [ProjectTaskCreatedByID] = @ProjectTaskCreatedByID, [ProjectTaskAssignedToUserID] = @ProjectTaskAssignedToUserID, [ProjectTaskProgress] = @ProjectTaskProgress, [ProjectTaskHours] = @ProjectTaskHours, [ProjectTaskGUID] = @ProjectTaskGUID, [ProjectTaskLastModified] = @ProjectTaskLastModified, [ProjectTaskProjectOrder] = @ProjectTaskProjectOrder, [ProjectTaskUserOrder] = @ProjectTaskUserOrder, [ProjectTaskNotificationSent] = @ProjectTaskNotificationSent, [ProjectTaskIsPrivate] = @ProjectTaskIsPrivate WHERE [ProjectTaskID] = @ProjectTaskID', 0, 2745, 0, '20101213 12:02:20', '5b2eba54-f9e3-4815-9261-c6abbce160bc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11828, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM PM_ProjectTask WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2745, 0, '20101213 12:02:20', '9a184cab-016a-4c6a-8f2a-cde57f1eaf64', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11829, N'deleteall', 0, N'DELETE FROM PM_ProjectTask WHERE ##WHERE##', 0, 2745, 0, '20101213 12:02:20', '8c5b6c89-d52d-4083-a73f-6b55d3d19f6a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11830, N'updateall', 0, N'UPDATE PM_ProjectTask SET ##COLUMNS## WHERE ##WHERE##', 0, 2745, 0, '20101213 12:02:20', '7eda1cf1-a069-405e-8f2e-22d4994b0a37', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11831, N'getoverduetasks', 0, N'SELECT PM_ProjectTask.* 
FROM PM_ProjectTask 
INNER JOIN PM_ProjectTaskStatus ON PM_ProjectTask.ProjectTaskStatusID = PM_ProjectTaskStatus.TaskStatusID
WHERE
  (TaskStatusIsFinished = 0) AND
  (ProjectTaskDueDate < @Date) AND
  (ProjectTaskAssignedToUserID > 0) AND
  ((ProjectTaskNotificationSent IS NULL) OR (ProjectTaskNotificationSent = 0))', 0, 2745, 0, '20101213 12:11:00', 'f147dfea-4a32-4055-b666-81f9fea68596', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11832, N'GetTasksCount', 0, N'Select COUNT (ProjectTaskID) FROM PM_ProjectTask WHERE ##WHERE##', 0, 2745, 0, '20101213 12:11:24', 'd9bcce48-c6ca-4b4e-9529-b84e4d318e62', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11833, N'inittaskorder', 1, N'Proc_PM_ProjectTask_InitOrders', 1, 2745, 0, '20101213 12:11:39', '04356d02-c89c-41f7-89f3-2ae7d825663d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11834, N'movedown', 1, N'Proc_PM_ProjectTask_MoveDown', 1, 2745, 0, '20101213 12:12:11', '201eea9c-b38b-499e-94d6-065d6bbec607', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11835, N'moveup', 1, N'Proc_PM_ProjectTask_MoveUp', 1, 2745, 0, '20101213 12:12:27', '02276ea6-0517-41a2-bc5d-89dd9488c47a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11836, N'selectalljoined', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_PM_ProjectTaskStatus_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2745, 0, '20101213 12:12:57', 'e9477f94-8104-4eb4-9726-95754de40d39', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11837, N'selectmodifiedfrom', 0, N'SELECT * FROM PM_ProjectTask WHERE (ProjectTaskLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2745, 0, '20101213 12:13:11', '98cf4f5f-b00c-4b09-8e86-42622c2d9b39', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11843, N'deleteall', 0, N'DELETE FROM PM_ProjectTaskPriority WHERE ##WHERE##', 0, 2746, 0, '20101213 12:15:05', 'ce33c990-6df9-4914-b61c-e0aac9b69e88', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11844, N'updateall', 0, N'UPDATE PM_ProjectTaskPriority SET ##COLUMNS## WHERE ##WHERE##', 0, 2746, 0, '20101213 12:15:05', 'c1175f40-5afd-43f0-8bc3-ef3644117713', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11838, N'select', 0, N'SELECT ##COLUMNS## FROM PM_ProjectTaskPriority WHERE [TaskPriorityID] = @ID', 0, 2746, 0, '20101213 12:15:04', '2f7b8e36-60e5-46a6-af2c-df67dceab8ad', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11839, N'delete', 0, N'DELETE FROM PM_ProjectTaskPriority WHERE [TaskPriorityID] = @ID', 0, 2746, 0, '20101213 12:15:05', '2ada8bae-c525-44ca-9c25-d311e34059fb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11840, N'insert', 0, N'INSERT INTO PM_ProjectTaskPriority ([TaskPriorityName], [TaskPriorityDisplayName], [TaskPriorityOrder], [TaskPriorityGUID], [TaskPriorityLastModified], [TaskPriorityEnabled], [TaskPriorityDefault] ) VALUES ( @TaskPriorityName, @TaskPriorityDisplayName, @TaskPriorityOrder, @TaskPriorityGUID, @TaskPriorityLastModified, @TaskPriorityEnabled, @TaskPriorityDefault); SELECT SCOPE_IDENTITY() AS [TaskPriorityID]', 1, 2746, 0, '20101213 12:15:05', 'e70d46ed-5296-4cbb-a873-73990966033c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11841, N'update', 0, N'UPDATE PM_ProjectTaskPriority SET [TaskPriorityName] = @TaskPriorityName, [TaskPriorityDisplayName] = @TaskPriorityDisplayName, [TaskPriorityOrder] = @TaskPriorityOrder, [TaskPriorityGUID] = @TaskPriorityGUID, [TaskPriorityLastModified] = @TaskPriorityLastModified, [TaskPriorityEnabled] = @TaskPriorityEnabled, [TaskPriorityDefault] = @TaskPriorityDefault WHERE [TaskPriorityID] = @TaskPriorityID', 0, 2746, 0, '20101213 12:15:05', '104f6ad0-b455-4de2-a26b-1a185f010669', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11842, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM PM_ProjectTaskPriority WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2746, 0, '20101213 12:15:05', 'ddd75eb0-c62f-4418-a85b-dc4dcfdc1b5d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11845, N'cleardefaults', 0, N'UPDATE PM_ProjectTaskPriority SET TaskPriorityDefault = 0', 0, 2746, 0, '20101213 12:19:11', '34bf29d2-af34-4a53-9259-bf829571b15b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11846, N'initpriorityorder', 1, N'Proc_PM_ProjectTaskPriority_InitOrders', 1, 2746, 0, '20101213 12:19:43', '3497a0a2-9dff-4b52-874f-1b5549729fb7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11847, N'movedown', 1, N'Proc_PM_ProjectTaskPriority_MoveDown', 1, 2746, 0, '20101213 12:20:04', 'c58a006d-9224-41de-8817-26a51184bf6f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11848, N'moveup', 1, N'Proc_PM_ProjectTaskPriority_MoveUp', 1, 2746, 0, '20101213 12:20:18', '9b15a53d-ac8c-42cb-9e3a-37c5b6745eac', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11850, N'selectmodifiedfrom', 0, N'SELECT * FROM PM_ProjectTaskPriority WHERE (TaskPriorityLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2746, 0, '20101213 12:20:58', '845721a9-a6d5-4334-83cf-43432c3a55e9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11856, N'deleteall', 0, N'DELETE FROM PM_ProjectTaskStatus WHERE ##WHERE##', 0, 2747, 0, '20101213 12:22:19', '7bc20d57-e0ec-44ab-87c6-c4291249ebb4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11857, N'updateall', 0, N'UPDATE PM_ProjectTaskStatus SET ##COLUMNS## WHERE ##WHERE##', 0, 2747, 0, '20101213 12:22:19', 'e59880bf-b265-47b4-b89e-442a3ae2b8e8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11851, N'select', 0, N'SELECT ##COLUMNS## FROM PM_ProjectTaskStatus WHERE [TaskStatusID] = @ID', 0, 2747, 0, '20101213 12:22:19', '856b009b-a12b-4cef-8a35-3f3c7287c725', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11852, N'delete', 0, N'DELETE FROM PM_ProjectTaskStatus WHERE [TaskStatusID] = @ID', 0, 2747, 0, '20101213 12:22:19', '85680d77-59e8-4734-a18b-bfac6e15fe39', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11853, N'insert', 0, N'INSERT INTO PM_ProjectTaskStatus ([TaskStatusName], [TaskStatusDisplayName], [TaskStatusOrder], [TaskStatusColor], [TaskStatusIcon], [TaskStatusGUID], [TaskStatusLastModified], [TaskStatusEnabled], [TaskStatusIsNotStarted], [TaskStatusIsFinished] ) VALUES ( @TaskStatusName, @TaskStatusDisplayName, @TaskStatusOrder, @TaskStatusColor, @TaskStatusIcon, @TaskStatusGUID, @TaskStatusLastModified, @TaskStatusEnabled, @TaskStatusIsNotStarted, @TaskStatusIsFinished); SELECT SCOPE_IDENTITY() AS [TaskStatusID]', 1, 2747, 0, '20101213 12:22:19', 'd8c743c0-2e00-434e-83ad-5425996e3155', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11854, N'update', 0, N'UPDATE PM_ProjectTaskStatus SET [TaskStatusName] = @TaskStatusName, [TaskStatusDisplayName] = @TaskStatusDisplayName, [TaskStatusOrder] = @TaskStatusOrder, [TaskStatusColor] = @TaskStatusColor, [TaskStatusIcon] = @TaskStatusIcon, [TaskStatusGUID] = @TaskStatusGUID, [TaskStatusLastModified] = @TaskStatusLastModified, [TaskStatusEnabled] = @TaskStatusEnabled, [TaskStatusIsNotStarted] = @TaskStatusIsNotStarted, [TaskStatusIsFinished] = @TaskStatusIsFinished WHERE [TaskStatusID] = @TaskStatusID', 0, 2747, 0, '20101213 12:22:19', '68dd0ed1-6ec1-40d6-b8b1-72ee7b044536', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11855, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM PM_ProjectTaskStatus WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2747, 0, '20101213 12:22:19', '60085200-b83d-48f4-af1e-3f096137fe17', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11858, N'initstatusorder', 1, N'Proc_PM_ProjectTaskStatus_InitOrders', 1, 2747, 0, '20101213 12:27:52', 'c19b1a66-edea-4d34-8d54-0d390191a82e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11859, N'movedown', 1, N'Proc_PM_ProjectTaskStatus_MoveDown', 1, 2747, 0, '20101213 12:28:14', '20ee573f-4b97-46f0-bade-6a8f1d447c6b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11860, N'moveup', 1, N'Proc_PM_ProjectTaskStatus_MoveUp', 1, 2747, 0, '20101213 12:28:29', '0dfbce4c-daec-477a-98c2-b22d433269fe', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11862, N'selectmodifiedfrom', 0, N'SELECT * FROM PM_ProjectTaskStatus WHERE (TaskStatusLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2747, 0, '20101213 12:29:09', '213021ba-4b93-432c-b206-f7a6b44c2a60', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2715, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_ShippingOption WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1150, 0, '20081229 09:07:02', 'a2b3a882-1179-4a99-9920-191dee0b0661', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11885, N'deleteall', 0, N'DELETE FROM COM_ShippingOption WHERE ##WHERE##', 0, 1150, 0, '20101215 09:36:43', '68f27961-ade0-48ce-9f9c-7953515a6fb3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11886, N'updateall', 0, N'UPDATE COM_ShippingOption SET ##COLUMNS## WHERE ##WHERE##', 0, 1150, 0, '20101215 09:36:43', '730bc527-f6e4-4cdb-995b-6ec976ffe3c7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2750, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Address WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1156, 0, '20081229 09:07:00', 'e4d4cb76-71f0-46a7-a49a-d9ac5f92a2f7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11923, N'deleteall', 0, N'DELETE FROM COM_Address WHERE ##WHERE##', 0, 1156, 0, '20101221 12:36:54', '8f717e4c-6d65-44e0-bae6-cdf2e2a5ae1e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11924, N'updateall', 0, N'UPDATE COM_Address SET ##COLUMNS## WHERE ##WHERE##', 0, 1156, 0, '20101221 12:36:54', '8aae0728-be46-4629-b5fd-fb682c6b7961', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2657, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Currency WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1143, 0, '20081229 09:07:00', '9ad7fb54-0b4e-4451-9b34-177df70311d3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11944, N'deleteall', 0, N'DELETE FROM COM_Currency WHERE ##WHERE##', 0, 1143, 0, '20101223 13:12:12', '4bf7029c-3bf4-44a8-9ab2-3f6e3c36b54c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11945, N'updateall', 0, N'UPDATE COM_Currency SET ##COLUMNS## WHERE ##WHERE##', 0, 1143, 0, '20101223 13:12:12', 'c06b4af9-2eae-4266-b72e-226f080020ba', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (505, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_WorkflowHistory WHERE [WorkflowHistoryID] = @ID', 0, 298, 0, '20081229 09:07:41', '28c53911-8ab1-4082-8d67-5c9081b212b0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5168, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WorkflowHistory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 298, 0, '20081229 09:07:41', '79b0c110-2c1b-473c-815e-88ecac41ca01', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11959, N'deleteall', 0, N'DELETE FROM CMS_WorkflowHistory WHERE ##WHERE##', 0, 298, 0, '20110104 19:43:59', '0f5809cf-b046-4987-97aa-b76b8f8fa8a9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11960, N'updateall', 0, N'UPDATE CMS_WorkflowHistory SET ##COLUMNS## WHERE ##WHERE##', 0, 298, 0, '20110104 19:43:59', '17baa19f-cb0b-4cbd-b826-2bdc77b9c79e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4679, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Messaging_Message WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1593, 0, '20081229 09:07:12', '691ff6c3-4478-4d11-9370-3b63b8713b65', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11961, N'updateall', 0, N'UPDATE Messaging_Message SET ##COLUMNS## WHERE ##WHERE##', 0, 1593, 0, '20110105 09:00:40', 'dc810498-07a5-41dd-9cfa-c37062da2689', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11656, N'markunread', 0, N'UPDATE Messaging_Message SET [MessageIsRead] = 0 WHERE ##WHERE##', 0, 1593, 0, '20110105 09:01:43', '5fb7ad92-0361-40b8-a475-000b676a5ad2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1304, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Newsletter_NewsletterIssue WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 907, 0, '20090910 14:21:30', 'ba8687d9-bb9c-42e9-af53-2c97548d8d53', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11966, N'deleteall', 0, N'DELETE FROM Newsletter_NewsletterIssue WHERE ##WHERE##', 0, 907, 0, '20110105 10:25:16', 'cc821292-ad8c-42d0-98ae-8280f7ab0e49', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11967, N'updateall', 0, N'UPDATE Newsletter_NewsletterIssue SET ##COLUMNS## WHERE ##WHERE##', 0, 907, 0, '20110105 10:25:16', 'c3c1f79a-7bdd-4ba3-9e21-fc10c5772ec6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11655, N'markread', 0, N'UPDATE Messaging_Message SET [MessageRead] = @MessageRead WHERE ##WHERE## AND MessageRead IS NULL;UPDATE Messaging_Message SET [MessageIsRead] = NULL WHERE ##WHERE##', 0, 1593, 0, '20110105 10:37:45', '84bf136a-752a-48af-b40d-25c52347edaf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6583, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Email WHERE [EmailID] = @ID', 0, 1809, 0, '20090911 10:01:36', '6a667a00-7726-4e32-be20-9225d4f1e963', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6587, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Email WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1809, 0, '20090911 10:01:36', 'f9cd911e-ed59-4059-be20-7a6526f05cc5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7347, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Email WHERE (EmailLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1809, 0, '20090911 10:01:36', '5d1c19b8-d43e-4684-ab5c-13560130ecd5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12116, N'updateall', 0, N'UPDATE CMS_Email SET ##COLUMNS## WHERE ##WHERE##', 0, 1809, 0, '20110111 16:38:50', '2b832d84-8438-4415-95d1-71d3d803201b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (813, N'selectbyguidnobinary', 0, N'SELECT ##TOPN## AttachmentID, AttachmentName, AttachmentExtension, AttachmentSize, AttachmentMimeType, AttachmentImageWidth, AttachmentImageHeight, AttachmentDocumentID, AttachmentGUID, AttachmentLastHistoryID, AttachmentSiteID, AttachmentLastModified,AttachmentIsUnsorted, AttachmentOrder, AttachmentGroupGUID, AttachmentFormGUID, AttachmentDocumentID, AttachmentHash, AttachmentTitle, AttachmentDescription, AttachmentCustomData FROM CMS_Attachment WHERE AttachmentGUID = @AttachmentGUID AND AttachmentSiteID = @AttachmentSiteID', 0, 504, 0, '20110112 11:35:56', 'ef0f16d5-c50e-4df4-9f10-5fe5d753d7d7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9046, N'getsearchposts', 0, N'SELECT ##TOPN## Forums_ForumPost.*, ForumSiteID FROM Forums_ForumPost LEFT JOIN Forums_Forum ON ForumID = PostForumID WHERE ##WHERE## ORDER BY PostId', 0, 1123, 0, '20110113 10:55:09', '1a9a7d55-f30e-4436-ae3c-c00db048a20d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2541, N'SelectAllWithPost', 0, N'SELECT ##TOPN## ##COLUMNS## FROM [Forums_ForumSubscription] LEFT JOIN [Forums_ForumPost] ON Forums_ForumPost.PostId = Forums_ForumSubscription.SubscriptionPostID WHERE SubscriptionForumID = @ForumID AND(##WHERE##) ORDER BY ##ORDERBY##', 0, 1124, 0, '20110113 10:59:38', '8136333d-4594-4636-bce7-654174d8a3ba', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7922, N'selectalljoined', 0, N'SELECT ##TOPN## Forums_UserFavorites.*,Forums_ForumPost.PostForumID, Forums_ForumPost.PostIdPath FROM Forums_UserFavorites
LEFT JOIN Forums_ForumPost ON Forums_ForumPost.PostId = Forums_UserFavorites.PostID WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1913, 0, '20110113 11:01:19', 'd8a10e04-de6b-49a8-b27b-312bc4b1de9d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3107, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Role WHERE [RoleID] = @ID', 0, 56, 0, '20081229 09:07:22', '9721a8dc-e38b-4cef-8c7a-3d93bd85334a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3108, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Role WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 56, 0, '20081229 09:07:22', '72e0075a-32c0-4950-a4f8-4676a6b4b767', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4857, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Role WHERE (RoleLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 56, 0, '20081229 09:07:22', 'f76ccc19-3a9a-4e0d-b6be-a37b051efbe8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12195, N'deleteall', 0, N'DELETE FROM CMS_Role WHERE ##WHERE##', 0, 56, 0, '20110117 14:24:19', '4a975553-cb35-4d00-867d-1fb3d349e6f4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12196, N'updateall', 0, N'UPDATE CMS_Role SET ##COLUMNS## WHERE ##WHERE##', 0, 56, 0, '20110117 14:24:19', 'ae81b184-1fc8-4d50-bd38-1aa55a4414fa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12199, N'getGlobalRolePermissionMatrix', 0, N'SELECT ##TOPN## Matrix.##COLUMNS##, CASE WHEN CMS_RolePermission.RoleID IS NULL THEN 0 ELSE 1 END AS Allowed FROM (SELECT CMS_Permission.PermissionID,  
CMS_Permission.PermissionOrder, CMS_Permission.PermissionDisplayName, CMS_Permission.PermissionName, CMS_Permission.ClassID, CMS_Permission.ResourceID,CMS_Permission.PermissionDescription, CMS_Role.RoleID, CMS_Role.Rolename, CMS_Role.RoleDisplayName FROM CMS_Permission, CMS_Role WHERE (CMS_Permission.PermissionDisplayInMatrix = @DisplayInMatrix OR ((@DisplayInMatrix=1) AND (CMS_Permission.PermissionDisplayInMatrix IS NULL))) AND ResourceID = @ID AND RoleID IN (SELECT RoleID FROM CMS_Role WHERE ##WHERE## AND (SiteID IS NULL)) ) Matrix LEFT JOIN CMS_RolePermission ON (Matrix.PermissionID = CMS_RolePermission.PermissionID AND CMS_RolePermission.RoleID = Matrix.RoleID) ORDER BY ##ORDERBY##', 0, 131, 0, '20110117 18:06:42', 'ebb02283-7f23-4a95-a4d3-426f4e90f2bc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9819, N'getResourcePermissionMatrix', 0, N'SELECT ##TOPN## Matrix.##COLUMNS##, CASE WHEN CMS_RolePermission.RoleID IS NULL THEN 0 ELSE 1 END AS Allowed FROM (SELECT CMS_Permission.PermissionID,  
CMS_Permission.PermissionOrder, CMS_Permission.PermissionDisplayName, CMS_Permission.PermissionName, CMS_Permission.ClassID, CMS_Permission.ResourceID,CMS_Permission.PermissionDescription, CMS_Role.RoleID, CMS_Role.Rolename, CMS_Role.RoleDisplayName FROM CMS_Permission, CMS_Role WHERE (CMS_Permission.PermissionDisplayInMatrix = @DisplayInMatrix OR ((@DisplayInMatrix=1) AND (CMS_Permission.PermissionDisplayInMatrix IS NULL))) AND ResourceID = @ID AND RoleID IN (SELECT RoleID FROM CMS_Role WHERE ##WHERE## AND ((@SiteID = 0 AND SiteID is NULL) OR SiteID = @SiteID)) ) Matrix LEFT JOIN CMS_RolePermission ON (Matrix.PermissionID = CMS_RolePermission.PermissionID AND CMS_RolePermission.RoleID = Matrix.RoleID) ORDER BY ##ORDERBY##', 0, 131, 0, '20110118 08:58:15', 'eda40db5-e8b1-4c74-beae-eb332c8a5ddd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9820, N'getClassPermissionMatrix', 0, N'SELECT ##TOPN## Matrix.##COLUMNS##, ''Allowed'' = CASE WHEN CMS_RolePermission.RoleID IS NULL THEN 0 ELSE 1 END FROM (SELECT CMS_Permission.PermissionID, 
CMS_Permission.PermissionOrder, CMS_Permission.PermissionDisplayName, CMS_Permission.PermissionName, CMS_Permission.ClassID, CMS_Permission.ClassID AS ResourceID,CMS_Permission.PermissionDescription, CMS_Role.RoleID, CMS_Role.Rolename, CMS_Role.RoleDisplayName FROM CMS_Permission, CMS_Role WHERE (CMS_Permission.PermissionDisplayInMatrix = @DisplayInMatrix OR ((@DisplayInMatrix=1) AND (CMS_Permission.PermissionDisplayInMatrix IS NULL))) AND ClassID = @ID AND RoleID IN (SELECT RoleID FROM CMS_Role WHERE ##WHERE## AND ((SiteID IS NULL AND @SiteID =0) OR SiteID = @SiteID)) ) Matrix LEFT JOIN CMS_RolePermission ON (Matrix.PermissionID = CMS_RolePermission.PermissionID AND CMS_RolePermission.RoleID = Matrix.RoleID) ORDER BY ##ORDERBY##', 0, 131, 0, '20110118 09:55:57', 'b4f22ef9-ac6e-4198-829f-3af1f2364f23', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12309, N'getroleusers', 1, N'Proc_Newsletter_Subscriber_GetRoleUsers', 0, 908, 0, '20110124 11:43:05', '6c5a6628-2fe5-4fc2-a9dc-ef45c810d966', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12308, N'selectUniqueDocumentNames', 0, N'SELECT DocumentName = CASE WHEN DocumentLastVersionName IS NOT NULL THEN DocumentLastVersionName ELSE DocumentName END
FROM View_CMS_Tree_Joined 
WHERE NodeParentID = @NodeParentID AND DocumentCulture = @DocumentCulture AND (##WHERE##)', 0, 143, 0, '20110125 18:49:11', 'c644d0f6-ee77-4805-ac9d-0de427887256', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12310, N'selectAllSettingsRoles', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_UserSettingsRole_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 59, 0, '20110126 14:53:13', '73e17c68-7537-403d-8c12-dc1683e196d9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (340, N'selectrequiredroles', 0, N'SELECT * FROM CMS_Role WHERE RoleID IN (SELECT RoleID FROM View_CMS_RoleResourcePermission_Joined WHERE PermissionName=@PermissionName AND ResourceName=@ResourceName) AND (SiteID=@SiteID OR SiteID IS NULL)', 0, 134, 0, '20110207 18:13:36', '34fc482a-6ec6-4ee6-9d89-c67d311f34a9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (339, N'selectrequiredroles', 0, N'SELECT * FROM CMS_Role WHERE RoleID IN (SELECT RoleID FROM CMS_RolePermission WHERE PermissionID IN (SELECT PermissionID FROM CMS_Permission WHERE ClassID=@ClassID AND PermissionName=@PermissionName)) AND (SiteID=@SiteID OR SiteID IS NULL)', 0, 145, 0, '20110208 11:49:11', 'f2dac7f2-dcb7-419a-b627-7efded496b36', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12346, N'deleteall', 0, N'DELETE FROM CMS_SMTPServerSite WHERE ##WHERE##', 0, 2805, 0, '20110210 15:14:45', 'bd229026-67ff-40a2-b1df-c9ee70abd6ba', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12347, N'updateall', 0, N'UPDATE CMS_SMTPServerSite SET ##COLUMNS## WHERE ##WHERE##', 0, 2805, 0, '20110210 15:14:45', '0db41568-5aad-4b36-ba69-4aa804996c1f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12341, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_SMTPServerSite WHERE [ServerID] = @ServerID AND [SiteID] = @SiteID', 0, 2805, 0, '20110210 15:14:45', '465f7ff1-a923-44ff-8d75-da97396241f6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12342, N'delete', 0, N'DELETE FROM CMS_SMTPServerSite WHERE [ServerID] = @ServerID AND [SiteID] = @SiteID', 0, 2805, 0, '20110210 15:14:45', '98199589-3ef0-49e7-a550-d85f4f91c6a7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12343, N'insert', 0, N'INSERT INTO CMS_SMTPServerSite ([ServerID], [SiteID] ) VALUES ( @ServerID, @SiteID);', 1, 2805, 0, '20110210 15:14:45', '334e8fd3-2248-4672-bc51-ebc6120ad2c6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12344, N'update', 0, N'SELECT NULL', 0, 2805, 0, '20110210 15:14:45', '4b9648ea-4d31-4efe-a97c-c6a8c3dac0c6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12345, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SMTPServerSite WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2805, 0, '20110210 15:14:45', '763f0492-09cb-4a88-96f6-bf1d162c04e3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12390, N'select', 0, N'SELECT ##COLUMNS## FROM OM_MVTCombinationVariation WHERE [MVTCombinationID] = @MVTCombinationID AND [MVTVariantID] = @MVTVariantID', 0, 2814, 0, '20110211 13:06:17', '7cb3baa7-0509-45ad-b581-0a7db2daf708', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12391, N'delete', 0, N'DELETE FROM OM_MVTCombinationVariation WHERE [MVTCombinationID] = @MVTCombinationID AND [MVTVariantID] = @MVTVariantID', 0, 2814, 0, '20110211 13:06:17', '8836f1ff-b9cb-46f7-be8a-cdfdc6fab67e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12392, N'insert', 0, N'INSERT INTO OM_MVTCombinationVariation ([MVTCombinationID], [MVTVariantID] ) VALUES ( @MVTCombinationID, @MVTVariantID);', 1, 2814, 0, '20110211 13:06:17', '4edcf9a6-2551-4511-abdd-ed2e6ba6a47d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12393, N'update', 0, N'SELECT NULL', 0, 2814, 0, '20110211 13:06:17', 'f4cf7ca3-2418-4cf3-afb6-4f9d8e03b706', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12394, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM OM_MVTCombinationVariation WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2814, 0, '20110211 13:06:17', '73f183ed-cf0c-408c-97c4-f07878814124', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12395, N'deleteall', 0, N'DELETE FROM OM_MVTCombinationVariation WHERE ##WHERE##', 0, 2814, 0, '20110211 13:06:17', 'a7582006-3566-4b36-a620-193dded0cc93', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12396, N'updateall', 0, N'UPDATE OM_MVTCombinationVariation SET ##COLUMNS## WHERE ##WHERE##', 0, 2814, 0, '20110211 13:06:17', '39f2bae9-0dd1-4d17-84d8-2682bc70b6e0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10546, N'GetRolePermissionMatrix', 0, N'SELECT ##TOPN## Matrix.##COLUMNS##, CASE WHEN CMS_RolePermission.RoleID IS NULL THEN 0 ELSE 1 END AS Allowed, @PermissionID AS PermissionID, @PermissionDisplayName AS PermissionDisplayName FROM (SELECT CMS_Role.RoleID, CMS_Role.Rolename, CMS_Role.RoleDisplayName FROM CMS_Role WHERE RoleID IN (SELECT RoleID FROM CMS_Role WHERE ##WHERE## AND ((@SiteID = 0 AND SiteID IS NULL) OR SiteID = @SiteID))) Matrix LEFT JOIN CMS_RolePermission ON ( CMS_RolePermission.RoleID = Matrix.RoleID AND CMS_RolePermission.PermissionID = @PermissionID) ORDER BY ##ORDERBY##', 0, 131, 0, '20110215 11:52:21', '2298bc40-90dd-4188-8879-c2625db621e1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6210, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_BannedIP WHERE [IPAddressID] = @ID', 0, 1740, 0, '20081229 09:07:11', 'a99bfbc1-f50e-40f1-ad4c-a456ba34f39e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7351, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_BannedIP WHERE (IPAddressLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1740, 0, '20081229 09:07:11', 'eaf9008c-217b-4a63-b041-b9e9cfe20a89', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12405, N'deleteall', 0, N'DELETE FROM CMS_BannedIP WHERE ##WHERE##', 0, 1740, 0, '20110215 13:25:30', '15891e0f-1fd1-41ca-aa7f-a29d3a9dd516', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12406, N'updateall', 0, N'UPDATE CMS_BannedIP SET ##COLUMNS## WHERE ##WHERE##', 0, 1740, 0, '20110215 13:25:30', '86b4e093-06cd-41fc-9892-906727a78f01', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12415, N'deleteall', 0, N'DELETE FROM CMS_MembershipRole WHERE ##WHERE##', 0, 2815, 0, '20110216 15:59:24', '184b02b2-128c-4904-98e0-00a92755cf27', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12416, N'updateall', 0, N'UPDATE CMS_MembershipRole SET ##COLUMNS## WHERE ##WHERE##', 0, 2815, 0, '20110216 15:59:24', '66b90404-be34-4037-ac81-0b4837ebe971', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12410, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_MembershipRole WHERE [MembershipID] = @MembershipID AND [RoleID] = @RoleID', 0, 2815, 0, '20110216 15:59:24', 'ad5bf040-8349-4f3e-8255-cd1e8578d41b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12411, N'delete', 0, N'DELETE FROM CMS_MembershipRole WHERE [MembershipID] = @MembershipID AND [RoleID] = @RoleID', 0, 2815, 0, '20110216 15:59:24', 'bf32461b-a813-455e-a4db-591b614a98b7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12412, N'insert', 0, N'INSERT INTO CMS_MembershipRole ([MembershipID], [RoleID] ) VALUES ( @MembershipID, @RoleID);', 1, 2815, 0, '20110216 15:59:24', '4ffc94f0-81bc-4065-847a-b7daf5a50902', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12413, N'update', 0, N'SELECT NULL', 0, 2815, 0, '20110216 15:59:24', 'cb9af64d-533c-49d9-8b6b-df6f0e029bbf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12414, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_MembershipRole WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2815, 0, '20110216 15:59:24', '2f4244bb-0fcf-44db-a6f7-f54a7d88fa7a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12441, N'getactiveserverids', 0, N'SELECT CMS_SMTPServer.ServerID FROM CMS_SMTPServer INNER JOIN CMS_SMTPServerSite ON CMS_SMTPServer.ServerID = CMS_SMTPServerSite.ServerID WHERE ServerEnabled = 1 AND SiteID = @SiteID ORDER BY CMS_SMTPServer.ServerID', 0, 2804, 0, '20110217 14:58:53', '56a70d47-984b-47be-8b2b-cea7122b54a2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12404, N'deletebindings', 0, N'DELETE FROM CMS_SMTPServerSite WHERE ServerID = @ServerID', 0, 2805, 0, '20110217 14:59:15', 'd2cdb486-0452-40b4-9552-9ffbc17a4dcc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2721, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_ExchangeTable WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1151, 0, '20081229 09:07:00', 'facd085c-ec13-4185-a782-5a50f9da3e37', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12448, N'deleteall', 0, N'DELETE FROM COM_ExchangeTable WHERE ##WHERE##', 0, 1151, 0, '20110218 09:48:20', 'dc4ddc8b-f0b3-4d63-bb9d-151579e2e0a4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12449, N'updateall', 0, N'UPDATE COM_ExchangeTable SET ##COLUMNS## WHERE ##WHERE##', 0, 1151, 0, '20110218 09:48:20', 'ec43d63d-c1c2-4380-85fc-7da2a43b8b2a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12479, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Wishlist WHERE [UserID] = @UserID AND [SiteID] = @SiteID AND [SKUID] = @SKUID', 0, 2822, 0, '20110225 13:28:13', 'e641f1db-c668-428d-87a5-48e3e32c0442', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12480, N'delete', 0, N'DELETE FROM COM_Wishlist WHERE [UserID] = @UserID AND [SiteID] = @SiteID AND [SKUID] = @SKUID', 0, 2822, 0, '20110225 13:28:13', 'e49e30bb-4a13-4699-91d7-c7a5fb758b7b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12483, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Wishlist WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2822, 0, '20110225 13:28:13', '62583d27-a952-4c8a-9a4c-35eb6d7166bb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12484, N'deleteall', 0, N'DELETE FROM COM_Wishlist WHERE ##WHERE##', 0, 2822, 0, '20110225 13:28:13', '782189f0-daa9-43e2-af72-ba57c570c84f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12485, N'updateall', 0, N'UPDATE COM_Wishlist SET ##COLUMNS## WHERE ##WHERE##', 0, 2822, 0, '20110225 13:28:13', 'fecf47b2-45ce-4be9-ad12-ab13b91d7f81', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6214, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_BannedIP WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1740, 0, '20110226 12:13:59', 'ff52dd27-0367-4735-9640-a44b3662589d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12476, N'selectallwithmembership', 0, N'SELECT ##TOPN## ##COLUMNS## FROM [View_Membership_MembershipUser_Joined] WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2820, 0, '20110228 13:05:25', '0a8bba1a-2518-4fa6-9375-05e60a374956', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12489, N'selectuserrole', 0, N'SELECT ##TOPN## ##COLUMNS## FROM [View_CMS_UserRole_Joined] WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 109, 0, '20110228 13:23:45', 'd345dc8f-310e-42fb-956a-c0de8a00817a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5223, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_UserRole WHERE [UserRoleID] = @ID', 0, 109, 0, '20081229 09:07:40', 'ebded362-48ab-42f7-9421-1002895d9c04', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5227, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_UserRole WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 109, 0, '20081229 09:07:40', '36a0e844-473f-4107-9139-9315a130a24b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12490, N'deleteall', 0, N'DELETE FROM CMS_UserRole WHERE ##WHERE##', 0, 109, 0, '20110228 13:22:21', 'bf6df02f-2397-4202-b302-39501c031ca1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12491, N'updateall', 0, N'UPDATE CMS_UserRole SET ##COLUMNS## WHERE ##WHERE##', 0, 109, 0, '20110228 13:22:21', '8c60e7ba-2b18-4307-90b8-c96a3651c361', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (897, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_CssStylesheet WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 555, 0, '20110301 18:15:02', '497645a8-a128-4094-8dc9-ab09ae8eef34', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (899, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_CssStylesheet WHERE [StylesheetID] = @ID', 0, 555, 0, '20110301 18:15:24', 'ad03bcd2-a1ba-4f38-a752-575d27245852', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4847, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_CssStylesheet WHERE (StylesheetLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 555, 0, '20110301 18:16:14', '5fdf4139-dc7b-448d-8581-203f6e999cb5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2567, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Staging_SyncLog WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1133, 0, '20110301 18:29:05', 'de476874-ee54-4830-b8be-97bbfc03df99', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12482, N'update', 0, N'UPDATE COM_Wishlist SET [SKUID] = @SKUID2 WHERE [UserID] = @UserID AND [SiteID] = @SiteID AND [SKUID] = @SKUID', 0, 2822, 0, '20110302 10:22:03', '4be146c7-09c9-465e-a25d-c8980f92899f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12525, N'getroleselementValid', 0, N'SELECT  ##TOPN## ##COLUMNS## FROM [View_CMS_SiteRoleResourceUIElementValid_Joined] WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2195, 0, '20110302 14:49:41', 'c18e2121-d4b4-4c0c-80a9-037788553a4e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12538, N'removedependencies', 1, N'Proc_CMS_Membership_RemoveDependencies', 0, 2785, 0, '20110303 12:56:43', 'aaad303c-737e-42c6-a095-c40713c1670a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12548, N'removedependencies', 1, N'Proc_CMS_WebPartContainer_RemoveDependencies', 0, 929, 0, '20110307 09:48:45', 'd97c3939-e297-4f68-9861-b1276104ebc5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12549, N'removedependencies', 1, N'Proc_CMS_WebFarmServer_RemoveDependencies', 0, 1093, 0, '20110307 09:50:20', '642372bb-03a6-4ff9-ba3b-392127afde65', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12550, N'removedependencies', 1, N'Proc_CMS_WebFarmTask_RemoveDependencies', 0, 1094, 0, '20110307 09:51:05', 'b1d60fe0-a587-4c9d-833e-e98dd9188a46', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12551, N'removedependencies', 1, N'Proc_CMS_Role_RemoveDependencies', 0, 56, 0, '20110307 09:52:03', '008a870b-9111-4a83-82ad-19771a2d2aaa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12552, N'removedependencies', 1, N'Proc_CMS_User_RemoveDependencies', 0, 59, 0, '20110307 09:53:33', 'd271ea22-8f88-48b9-b5e5-0d496f00cf4a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12553, N'removedependencies', 1, N'Proc_CMS_SearchIndex_RemoveDependencies', 0, 2043, 0, '20110307 09:54:29', '99349c99-ee5c-44df-b089-559f23a13f8c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12526, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_ObjectVersionHistory WHERE [VersionID] = @ID', 0, 2828, 0, '20110303 11:04:55', '61183f11-df92-4fed-bece-0a26c5399ac8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12527, N'delete', 0, N'DELETE FROM CMS_ObjectVersionHistory WHERE [VersionID] = @ID', 0, 2828, 0, '20110303 11:04:55', 'ef312c15-a1f5-4e2b-b8b3-c70ad8cf298a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12528, N'insert', 0, N'INSERT INTO CMS_ObjectVersionHistory ([VersionObjectID], [VersionObjectType], [VersionObjectSiteID], [VersionObjectDisplayName], [VersionXML], [VersionBinaryDataXML], [VersionModifiedByUserID], [VersionModifiedWhen], [VersionDeletedByUserID], [VersionDeletedWhen], [VersionNumber], [VersionSiteBindingIDs] ) VALUES ( @VersionObjectID, @VersionObjectType, @VersionObjectSiteID, @VersionObjectDisplayName, @VersionXML, @VersionBinaryDataXML, @VersionModifiedByUserID, @VersionModifiedWhen, @VersionDeletedByUserID, @VersionDeletedWhen, @VersionNumber, @VersionSiteBindingIDs); SELECT SCOPE_IDENTITY() AS [VersionID]', 1, 2828, 0, '20110303 11:04:55', '8b819d95-269d-474a-b2c0-1e6358ff44ab', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12529, N'update', 0, N'UPDATE CMS_ObjectVersionHistory SET [VersionObjectID] = @VersionObjectID, [VersionObjectType] = @VersionObjectType, [VersionObjectSiteID] = @VersionObjectSiteID, [VersionObjectDisplayName] = @VersionObjectDisplayName, [VersionXML] = @VersionXML, [VersionBinaryDataXML] = @VersionBinaryDataXML, [VersionModifiedByUserID] = @VersionModifiedByUserID, [VersionModifiedWhen] = @VersionModifiedWhen, [VersionDeletedByUserID] = @VersionDeletedByUserID, [VersionDeletedWhen] = @VersionDeletedWhen, [VersionNumber] = @VersionNumber, [VersionSiteBindingIDs] = @VersionSiteBindingIDs WHERE [VersionID] = @VersionID', 0, 2828, 0, '20110303 11:04:55', '7f6b9228-fabe-4595-99a6-87da62f34f6b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12530, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_ObjectVersionHistory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2828, 0, '20110303 11:04:55', 'c2397179-a4df-4935-81f2-a88c3a283bea', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12531, N'deleteall', 0, N'DELETE FROM CMS_ObjectVersionHistory WHERE ##WHERE##', 0, 2828, 0, '20110303 11:04:55', '48be625d-0255-4855-b87f-173830077d39', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12532, N'updateall', 0, N'UPDATE CMS_ObjectVersionHistory SET ##COLUMNS## WHERE ##WHERE##', 0, 2828, 0, '20110303 11:04:55', '7790f5b1-761d-44b2-bacb-11540a715def', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12563, N'SelectOlderVersions', 0, N'SELECT ##COLUMNS## FROM CMS_ObjectVersionHistory WHERE VersionObjectID = @ObjectID AND VersionObjectType = @ObjectType AND VersionID NOT IN (SELECT ##TOPN## VersionID FROM CMS_ObjectVersionHistory WHERE VersionObjectID = @ObjectID AND VersionObjectType = @ObjectType ORDER BY VersionID DESC)', 0, 2828, 0, '20110307 15:13:20', 'a0cbaeca-8b6d-47e5-9bfa-8224aa60b28a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12497, N'selectrolesbymembership', 0, N'SELECT ##TOPN## ##COLUMNS##
FROM CMS_Role JOIN CMS_MembershipRole ON CMS_MembershipRole.RoleID = CMS_Role.RoleID 
                       JOIN CMS_MembershipUser ON CMS_MembershipUser.MembershipID = CMS_MembershipRole.MembershipID                    
                       WHERE ##WHERE## AND @UserID = CMS_MembershipUser.UserID ORDER BY ##ORDERBY##', 0, 59, 0, '20110308 13:12:31', '941c7e8f-fc31-4577-bb35-4bc1b3efaa18', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12571, N'changeobjectid', 0, N'UPDATE CMS_ObjectVersionHistory SET VersionObjectID = @NewObjectID WHERE VersionObjectID = @OriginalObjectID AND VersionObjectType = @ObjectType', 0, 2828, 0, '20110308 13:21:00', '9deace2f-1f63-491d-9957-f9be0d27ea41', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12459, N'removefromwebanalytics', 1, N'Proc_OM_RemoveDataFromWebAnalytics', 0, 2491, 0, '20110309 17:11:56', 'bb5dbaca-b9a2-4c87-bcf1-02081f94e073', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4309, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_MetaFile WHERE [MetaFileID] = @ID', 0, 1527, 0, '20081229 09:07:12', '29a7285b-f422-4d8d-a476-c00d72f2242c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4313, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_MetaFile WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1527, 0, '20081229 09:07:12', 'e4c13268-8063-418e-b468-340887f76b73', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5001, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_MetaFile WHERE (MetaFileLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1527, 0, '20081229 09:07:12', '211f0cc8-9d92-4d8e-ad88-ee0d86c359c3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7619, N'selectnobinary', 0, N'SELECT [MetaFileID], [MetaFileObjectID], [MetaFileObjectType], [MetaFileGroupName], [MetaFileName], [MetaFileExtension], [MetaFileSize], [MetaFileMimeType], [MetaFileImageWidth], [MetaFileImageHeight], [MetaFileGUID], [MetaFileLastModified], [MetaFileSiteID], [MetaFileTitle], [MetaFileDescription], [MetaFileCustomData] FROM CMS_MetaFile WHERE [MetaFileID] = @ID', 0, 1527, 0, '20081229 09:07:12', 'b944b047-6373-43df-b3ac-6bfc48c37cf2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5215, N'selectallnobinary', 0, N'SELECT ##TOPN## [MetaFileID], [MetaFileObjectID], [MetaFileObjectType], [MetaFileGroupName], [MetaFileName], [MetaFileExtension], [MetaFileSize], [MetaFileMimeType], [MetaFileImageWidth], [MetaFileImageHeight], [MetaFileGUID], [MetaFileLastModified], [MetaFileSiteID], [MetaFileTitle], [MetaFileDescription], [MetaFileCustomData] ##COLUMNS## FROM CMS_MetaFile WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1527, 0, '20110214 21:47:07', 'a4575f5c-0287-4224-9a35-82769e6ff369', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12583, N'deleteall', 0, N'DELETE FROM CMS_MetaFile WHERE ##WHERE##', 0, 1527, 0, '20110314 10:46:21', '2927faf8-3980-44b2-883d-6d3107b42c93', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12584, N'updateall', 0, N'UPDATE CMS_MetaFile SET ##COLUMNS## WHERE ##WHERE##', 0, 1527, 0, '20110314 10:46:21', 'cf0e2d83-aa9b-4649-9ca1-84a91dbd1ada', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12590, N'updateall', 0, N'UPDATE COM_CurrencyExchangeRate SET ##COLUMNS## WHERE ##WHERE##', 0, 1202, 0, '20110315 16:07:06', 'a1c6f346-22b7-4196-a33a-f34c2e7173d2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12591, N'updateall', 0, N'UPDATE COM_DiscountCoupon SET ##COLUMNS## WHERE ##WHERE##', 0, 1149, 0, '20110315 16:07:47', 'b010f447-aca3-4ece-baa7-3ed2bf121432', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12592, N'updateall', 0, N'UPDATE COM_DiscountLevel SET ##COLUMNS## WHERE ##WHERE##', 0, 1429, 0, '20110315 16:10:14', '0e2e3759-f562-4746-91f2-8cac79517a9b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12595, N'updateall', 0, N'UPDATE COM_ShippingCost SET ##COLUMNS## WHERE ##WHERE##', 0, 2461, 0, '20110315 16:15:08', 'd20dd02b-2234-45bb-836a-0183bbf460c7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12481, N'insert', 0, N'INSERT INTO COM_Wishlist ([UserID], [SiteID], [SKUID]) VALUES (@UserID, @SiteID, @SKUID);', 1, 2822, 0, '20110316 12:12:42', '6dc111d0-825e-4966-ad7d-e6753df63d05', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12597, N'CheckEnabledOptions', 0, N'SELECT TOP 1 SKUID 
FROM COM_SKU
WHERE SKUOptionCategoryID IN
(
  SELECT c.CategoryID 
  FROM COM_SKUOptionCategory AS sc LEFT OUTER JOIN COM_OptionCategory AS c ON (sc.CategoryID = c.CategoryID)
  WHERE sc.SKUID = @SKUID AND c.CategoryEnabled = 1
)
AND SKUEnabled = 1', 0, 1159, 0, '20110316 16:53:21', '5b090173-2352-40df-977f-28edde55bb40', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12610, N'updateall', 0, N'UPDATE COM_VolumeDiscount SET ##COLUMNS## WHERE ##WHERE##', 0, 1424, 0, '20110318 08:09:06', '0ad102a0-d7cf-4686-88bc-b57c4ccd342e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2818, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_OrderStatusUser WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1163, 0, '20081229 09:07:02', 'f6796f65-2cbf-4905-9098-cd989923e440', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12745, N'deleteall', 0, N'DELETE FROM COM_OrderStatusUser WHERE ##WHERE##', 0, 1163, 0, '20110323 11:49:56', 'f0b9f5cd-b7e6-46d5-ad33-1bf50b025d76', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12746, N'updateall', 0, N'UPDATE COM_OrderStatusUser SET ##COLUMNS## WHERE ##WHERE##', 0, 1163, 0, '20110323 11:49:56', '463fddb9-cc79-44b2-a24a-570ec1b0a9a1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (40, N'selectbyname', 0, N'SELECT CMS_Role.* FROM CMS_Role   WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 56, 0, '20110323 15:08:55', '7a60dc16-2456-4f5c-8120-54094eae5ad2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (665, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_WebPart WHERE [WebPartID] = @ID', 0, 425, 0, '20110324 14:25:53', '96f39a04-d16e-4bee-aa72-54205164de35', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (658, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebPart WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 425, 0, '20110324 14:25:53', '819a8a14-e087-43d7-b15f-286902279adc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4862, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebPart WHERE (WebPartLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 425, 0, '20110324 14:25:53', '05cd2bf6-3a41-4c73-8680-c285772c87a9', 0, NULL)
SET IDENTITY_INSERT [CMS_Query] OFF
